package com.lxx.utils;

import java.util.List;

public class Pagination<T> {
	private Integer pageIndex = Constant.PAGE_INIT_INDEX;
	private Integer totalRow = Constant.PAGE_INIT_ROW_SIZE;
	private Integer totalPage;
	private Integer pageSize = Constant.PAGE_INIT_SIZE;
	
	private List<T> datas;
	
	
	public Integer getPageIndex() {
		return pageIndex;
	}
	public void setPageIndex(Integer pageIndex) {
		this.pageIndex = pageIndex;
	}
	public Integer getTotalRow() {
		return totalRow;
	}
	public void setTotalRow(Integer totalRow) {
		this.totalRow = totalRow;
		this.totalPage = totalRow / pageSize + 1;
	}
	public Integer getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}
	public Integer getPageSize() {
		return pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public List<T> getDatas() {
		return datas;
	}
	public void setDatas(List<T> datas) {
		this.datas = datas;
	}
	@Override
	public String toString() {
		return "Pagination [pageIndex=" + pageIndex + ", totalRow=" + totalRow + ", totalPage=" + totalPage
				+ ", pageSize=" + pageSize + ", datas=" + datas + "]";
	}
}
